#coding=utf-8
#Boa:FramePanel:PanelDeliveryPlanContent

import wx
from wx.lib.splitter import MultiSplitterWindow

from ctrlAider import *
from product import CDataStaff,CDataTruck
from product import CDataDeliveryPlan,CDataDeliveryState,CDataDeliveryRoute

from MyListCtrl import MyListCtrlRouteDetail,MyListCtrlRegionCustomer,MyListCtrlDeliverySaleOrder
from MyListCtrl import MyOrderContentListCtrl,MyListCtrlDeliveryPlanProDetail


[wxID_PANELDELIVERYPLANCONTENT, wxID_PANELDELIVERYPLANCONTENTBTNSAVE, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_ALL_REGION, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_CHECKIT, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_LATER, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_MEMO_INPUT, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_NOANSWER, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_NO_NEED, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_ORDER, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_PHONE, 
 wxID_PANELDELIVERYPLANCONTENTBUTTON_WECHAT, 
 wxID_PANELDELIVERYPLANCONTENTCHECKBOX_ALARM_CUSTOMER, 
 wxID_PANELDELIVERYPLANCONTENTCHECKBOX_HASDEBT, 
 wxID_PANELDELIVERYPLANCONTENTCHECKBOX_ONLY_SHOP, 
 wxID_PANELDELIVERYPLANCONTENTCHOICE_HOUR_RETURN, 
 wxID_PANELDELIVERYPLANCONTENTCHOICE_HOUR_SEND, 
 wxID_PANELDELIVERYPLANCONTENTCHOICE_HOUR_SUBMIT, 
 wxID_PANELDELIVERYPLANCONTENTCHOICE_MIN_RETURN, 
 wxID_PANELDELIVERYPLANCONTENTCHOICE_MIN_SEND, 
 wxID_PANELDELIVERYPLANCONTENTCHOICE_MIN_SUBMIT, 
 wxID_PANELDELIVERYPLANCONTENTCOMBODRIVER, 
 wxID_PANELDELIVERYPLANCONTENTCOMBOFOLLOWER, 
 wxID_PANELDELIVERYPLANCONTENTCOMBOSTATE, 
 wxID_PANELDELIVERYPLANCONTENTCOMBOSUBMIT, 
 wxID_PANELDELIVERYPLANCONTENTCOMBOTRUCK, 
 wxID_PANELDELIVERYPLANCONTENTDATERETURN, 
 wxID_PANELDELIVERYPLANCONTENTDATESEND, 
 wxID_PANELDELIVERYPLANCONTENTDATESUBMIT, 
 wxID_PANELDELIVERYPLANCONTENTNOTEBOOK1, wxID_PANELDELIVERYPLANCONTENTPANEL1, 
 wxID_PANELDELIVERYPLANCONTENTPANEL2, wxID_PANELDELIVERYPLANCONTENTPANEL3, 
 wxID_PANELDELIVERYPLANCONTENTPANEL_BASIC, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT10, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT11, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT12, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT2, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT3, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT4, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT5, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT6, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT7, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT8, 
 wxID_PANELDELIVERYPLANCONTENTSTATICTEXT9, wxID_PANELDELIVERYPLANCONTENTTCAR, 
 wxID_PANELDELIVERYPLANCONTENTTCMEALSFEE, wxID_PANELDELIVERYPLANCONTENTTCMEMO, 
 wxID_PANELDELIVERYPLANCONTENTTCOTHERFEE, 
 wxID_PANELDELIVERYPLANCONTENTTCRETURNKM, 
 wxID_PANELDELIVERYPLANCONTENTTCRETURNMEMO, 
 wxID_PANELDELIVERYPLANCONTENTTCSENDKM, 
 wxID_PANELDELIVERYPLANCONTENTTCTOLLFEE, wxID_PANELDELIVERYPLANCONTENTTDRIVER, 
 wxID_PANELDELIVERYPLANCONTENTTFOLLOWER, wxID_PANELDELIVERYPLANCONTENTTMEMO, 
 wxID_PANELDELIVERYPLANCONTENTTRETURNDATE, 
 wxID_PANELDELIVERYPLANCONTENTTSENDDATE, wxID_PANELDELIVERYPLANCONTENTTSTATE, 
] = [wx.NewId() for _init_ctrls in range(58)]

class PanelDeliveryPlanContent(wx.Panel):
    def _init_coll_notebook1_Pages(self, parent):
         # generated method, don't edit
 
         
        parent.AddPage(imageId=-1, page=self.panel1, select=True,
              text=u'\u8ba2\u5355\u4e00\u89c8')
        parent.AddPage(imageId=-1, page=self.panel_basic, select=False,
              text=u'\u57fa\u672c\u4fe1\u606f')
        parent.AddPage(imageId=-1, page=self.panel3, select=False,
              text=u'\u8054\u7cfb\u5ba2\u6237')
        parent.AddPage(imageId=-1, page=self.panel2, select=False,
              text=u'\u968f\u8f66\u4ea7\u54c1\u6e05\u5355')
         
         
 

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Panel.__init__(self, id=wxID_PANELDELIVERYPLANCONTENT,
              name=u'PANELDELIVERYPLANCONTENT', parent=prnt, pos=wx.Point(309,
              228), size=wx.Size(1041, 418), style=wx.TAB_TRAVERSAL)
        self.SetClientSize(wx.Size(1025, 380))
        self.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              u'\u6977\u4f53_GB2312'))
        self.SetBackgroundColour(wx.Colour(183, 209, 173))

        self.notebook1 = wx.Notebook(id=wxID_PANELDELIVERYPLANCONTENTNOTEBOOK1,
              name='notebook1', parent=self, pos=wx.Point(0, 0),
              size=wx.Size(1024, 376), style=wx.STATIC_BORDER)

        self.panel1 = wx.Panel(id=wxID_PANELDELIVERYPLANCONTENTPANEL1,
              name='panel1', parent=self.notebook1, pos=wx.Point(0, 0),
              size=wx.Size(1016, 346), style=wx.TAB_TRAVERSAL)

        self.panel2 = wx.Panel(id=wxID_PANELDELIVERYPLANCONTENTPANEL2,
              name='panel2', parent=self.notebook1, pos=wx.Point(0, 0),
              size=wx.Size(1016, 346), style=wx.TAB_TRAVERSAL)

        self.panel3 = wx.Panel(id=wxID_PANELDELIVERYPLANCONTENTPANEL3,
              name='panel3', parent=self.notebook1, pos=wx.Point(0, 0),
              size=wx.Size(1016, 346), style=wx.TAB_TRAVERSAL)

        self.button_no_need = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_NO_NEED,
              label=u'\u4e0d\u8981\u8d27', name=u'button_no_need',
              parent=self.panel3, pos=wx.Point(680, 48), size=wx.Size(93, 26),
              style=0)
        self.button_no_need.Bind(wx.EVT_BUTTON, self.OnButton_no_needButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_NO_NEED)

        self.checkBox_only_shop = wx.CheckBox(id=wxID_PANELDELIVERYPLANCONTENTCHECKBOX_ONLY_SHOP,
              label=u'\u53ea\u663e\u793a\u4e94\u91d1\u5e97\u5ba2\u6237',
              name=u'checkBox_only_shop', parent=self.panel3, pos=wx.Point(180,
              16), size=wx.Size(168, 16), style=0)
        self.checkBox_only_shop.SetValue(True)
        self.checkBox_only_shop.Bind(wx.EVT_CHECKBOX,
              self.OnCheckBox_only_shopCheckbox,
              id=wxID_PANELDELIVERYPLANCONTENTCHECKBOX_ONLY_SHOP)

        self.button_later = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_LATER,
              label=u'\u518d\u8054\u7cfb', name=u'button_later',
              parent=self.panel3, pos=wx.Point(776, 48), size=wx.Size(93, 26),
              style=0)
        self.button_later.Bind(wx.EVT_BUTTON, self.OnButton_laterButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_LATER)

        self.button_memo_input = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_MEMO_INPUT,
              label=u'\u5176\u4ed6', name=u'button_memo_input',
              parent=self.panel3, pos=wx.Point(872, 48), size=wx.Size(93, 26),
              style=0)
        self.button_memo_input.Bind(wx.EVT_BUTTON,
              self.OnButton_memo_inputButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_MEMO_INPUT)

        self.button_all_region = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_ALL_REGION,
              label=u'\u5168\u90e8\u533a\u57df', name=u'button_all_region',
              parent=self.panel3, pos=wx.Point(8, 8), size=wx.Size(160, 26),
              style=0)
        self.button_all_region.Bind(wx.EVT_BUTTON,
              self.OnButton_all_regionButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_ALL_REGION)

        self.button_order = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_ORDER,
              label=u'\u5df2\u4e0b\u5355', name=u'button_order',
              parent=self.panel3, pos=wx.Point(380, 48), size=wx.Size(93, 26),
              style=0)
        self.button_order.Bind(wx.EVT_BUTTON, self.OnButton_orderButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_ORDER)

        self.button_wechat = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_WECHAT,
              label=u'\u5df2\u5fae\u4fe1', name=u'button_wechat',
              parent=self.panel3, pos=wx.Point(180, 48), size=wx.Size(93, 26),
              style=0)
        self.button_wechat.Bind(wx.EVT_BUTTON, self.OnButton_wechatButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_WECHAT)

        self.button_checkit = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_CHECKIT,
              label=u'\u770b\u4e00\u4e0b', name=u'button_checkit',
              parent=self.panel3, pos=wx.Point(776, 16), size=wx.Size(93, 26),
              style=0)
        self.button_checkit.Bind(wx.EVT_BUTTON, self.OnButton_checkitButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_CHECKIT)

        self.button_noanswer = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_NOANSWER,
              label=u'\u6ca1\u6253\u901a', name=u'button_noanswer',
              parent=self.panel3, pos=wx.Point(680, 16), size=wx.Size(93, 26),
              style=0)
        self.button_noanswer.Bind(wx.EVT_BUTTON, self.OnButton_noanswerButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_NOANSWER)

        self.button_phone = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBUTTON_PHONE,
              label=u'\u5df2\u7535\u8bdd', name=u'button_phone',
              parent=self.panel3, pos=wx.Point(280, 48), size=wx.Size(93, 26),
              style=0)
        self.button_phone.Bind(wx.EVT_BUTTON, self.OnButton_phoneButton,
              id=wxID_PANELDELIVERYPLANCONTENTBUTTON_PHONE)

        self.panel_basic = wx.Panel(id=wxID_PANELDELIVERYPLANCONTENTPANEL_BASIC,
              name=u'panel_basic', parent=self.notebook1, pos=wx.Point(0, 0),
              size=wx.Size(1016, 346), style=wx.TAB_TRAVERSAL)
        self.panel_basic.SetBackgroundColour(wx.Colour(183, 209, 173))

        self.tDriver = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTTDRIVER,
              label=u'\u53f8\u673a\uff1a', name=u'tDriver',
              parent=self.panel_basic, pos=wx.Point(24, 24), size=wx.Size(51,
              16), style=0)

        self.comboDriver = wx.ComboBox(choices=[],
              id=wxID_PANELDELIVERYPLANCONTENTCOMBODRIVER, name=u'comboDriver',
              parent=self.panel_basic, pos=wx.Point(80, 16), size=wx.Size(100,
              24), style=0, value=u'')
        self.comboDriver.SetLabel(u'')

        self.tCar = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTTCAR,
              label=u'\u8f66\u8f86\uff1a', name=u'tCar',
              parent=self.panel_basic, pos=wx.Point(208, 24), size=wx.Size(51,
              16), style=0)

        self.comboTruck = wx.ComboBox(choices=[],
              id=wxID_PANELDELIVERYPLANCONTENTCOMBOTRUCK, name=u'comboTruck',
              parent=self.panel_basic, pos=wx.Point(272, 16), size=wx.Size(100,
              24), style=0, value=u'')
        self.comboTruck.SetLabel(u'')

        self.comboState = wx.ComboBox(choices=[],
              id=wxID_PANELDELIVERYPLANCONTENTCOMBOSTATE, name=u'comboState',
              parent=self.panel_basic, pos=wx.Point(272, 48), size=wx.Size(100,
              24), style=0, value=u'')
        self.comboState.SetLabel(u'')

        self.tState = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTTSTATE,
              label=u'\u72b6\u6001\uff1a', name=u'tState',
              parent=self.panel_basic, pos=wx.Point(208, 56), size=wx.Size(51,
              16), style=0)

        self.comboFollower = wx.ComboBox(choices=[],
              id=wxID_PANELDELIVERYPLANCONTENTCOMBOFOLLOWER,
              name=u'comboFollower', parent=self.panel_basic, pos=wx.Point(80,
              48), size=wx.Size(100, 24), style=0, value=u'')
        self.comboFollower.SetLabel(u'')

        self.tFollower = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTTFOLLOWER,
              label=u'\u8ddf\u8f66\uff1a', name=u'tFollower',
              parent=self.panel_basic, pos=wx.Point(24, 56), size=wx.Size(51,
              16), style=0)

        self.staticText4 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT4,
              label=u'\u4ea4\u5355\uff1a', name='staticText4',
              parent=self.panel_basic, pos=wx.Point(24, 88), size=wx.Size(51,
              16), style=0)

        self.comboSubmit = wx.ComboBox(choices=[],
              id=wxID_PANELDELIVERYPLANCONTENTCOMBOSUBMIT, name=u'comboSubmit',
              parent=self.panel_basic, pos=wx.Point(80, 80), size=wx.Size(100,
              24), style=0, value=u'')
        self.comboSubmit.SetLabel(u'')

        self.tcMemo = wx.TextCtrl(id=wxID_PANELDELIVERYPLANCONTENTTCMEMO,
              name=u'tcMemo', parent=self.panel_basic, pos=wx.Point(80, 112),
              size=wx.Size(288, 26), style=0, value=u'')

        self.tMemo = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTTMEMO,
              label=u'\u5907\u6ce8\uff1a', name=u'tMemo',
              parent=self.panel_basic, pos=wx.Point(24, 120), size=wx.Size(51,
              16), style=0)

        self.staticText7 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT7,
              label=u'\u9000\u8d27', name='staticText7',
              parent=self.panel_basic, pos=wx.Point(24, 152), size=wx.Size(34,
              16), style=0)

        self.TCReturnMemo = wx.TextCtrl(id=wxID_PANELDELIVERYPLANCONTENTTCRETURNMEMO,
              name=u'TCReturnMemo', parent=self.panel_basic, pos=wx.Point(80,
              152), size=wx.Size(288, 120),
              style=wx.HSCROLL | wx.VSCROLL | wx.TE_MULTILINE,
              value=u'\u9000\u8d27\uff1a\n\u7b7e\u5355\uff1a\n\u57ab\u4ed8\uff1a\n\u63d0\u6210\uff1a')

        self.staticText12 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT12,
              label=u'\u5176\u4ed6\u8d39\u7528\uff1a', name='staticText12',
              parent=self.panel_basic, pos=wx.Point(400, 248), size=wx.Size(85,
              16), style=0)

        self.TCOtherFee = wx.TextCtrl(id=wxID_PANELDELIVERYPLANCONTENTTCOTHERFEE,
              name=u'TCOtherFee', parent=self.panel_basic, pos=wx.Point(488,
              240), size=wx.Size(112, 26), style=0, value=u'0')

        self.staticText11 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT11,
              label=u'\u9910\u8865\uff1a', name='staticText11',
              parent=self.panel_basic, pos=wx.Point(400, 216), size=wx.Size(51,
              16), style=0)

        self.TCMealsFee = wx.TextCtrl(id=wxID_PANELDELIVERYPLANCONTENTTCMEALSFEE,
              name=u'TCMealsFee', parent=self.panel_basic, pos=wx.Point(488,
              208), size=wx.Size(112, 26), style=0, value=u'0')

        self.staticText10 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT10,
              label=u'\u9ad8\u901f\u8d39\uff1a', name='staticText10',
              parent=self.panel_basic, pos=wx.Point(400, 184), size=wx.Size(68,
              16), style=0)

        self.TCTollFee = wx.TextCtrl(id=wxID_PANELDELIVERYPLANCONTENTTCTOLLFEE,
              name=u'TCTollFee', parent=self.panel_basic, pos=wx.Point(488,
              176), size=wx.Size(112, 26), style=0, value=u'0')

        self.staticText9 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT9,
              label=u'\u6536\u8f66\u91cc\u7a0b\uff1a', name='staticText9',
              parent=self.panel_basic, pos=wx.Point(400, 152), size=wx.Size(85,
              16), style=0)

        self.TCReturnKM = wx.TextCtrl(id=wxID_PANELDELIVERYPLANCONTENTTCRETURNKM,
              name=u'TCReturnKM', parent=self.panel_basic, pos=wx.Point(488,
              144), size=wx.Size(112, 26), style=0, value=u'0')

        self.staticText6 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT6,
              label=u'\u51fa\u8f66\u91cc\u7a0b\uff1a', name='staticText6',
              parent=self.panel_basic, pos=wx.Point(400, 120), size=wx.Size(85,
              16), style=0)

        self.TCSendKM = wx.TextCtrl(id=wxID_PANELDELIVERYPLANCONTENTTCSENDKM,
              name=u'TCSendKM', parent=self.panel_basic, pos=wx.Point(488, 112),
              size=wx.Size(112, 26), style=0, value=u'0')

        self.staticText5 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT5,
              label=u'\u4ea4\u5355\u65f6\u95f4\uff1a', name='staticText5',
              parent=self.panel_basic, pos=wx.Point(400, 88), size=wx.Size(85,
              16), style=0)

        self.tReturnDate = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTTRETURNDATE,
              label=u'\u6536\u8f66\u65f6\u95f4\uff1a', name=u'tReturnDate',
              parent=self.panel_basic, pos=wx.Point(400, 56), size=wx.Size(85,
              16), style=0)

        self.tSendDate = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTTSENDDATE,
              label=u'\u51fa\u8f66\u65f6\u95f4\uff1a', name=u'tSendDate',
              parent=self.panel_basic, pos=wx.Point(400, 24), size=wx.Size(85,
              16), style=0)

        self.dateSend = wx.DatePickerCtrl(id=wxID_PANELDELIVERYPLANCONTENTDATESEND,
              name=u'dateSend', parent=self.panel_basic, pos=wx.Point(488, 16),
              size=wx.Size(112, 24), style=wx.DP_SHOWCENTURY)

        self.dateReturn = wx.DatePickerCtrl(id=wxID_PANELDELIVERYPLANCONTENTDATERETURN,
              name=u'dateReturn', parent=self.panel_basic, pos=wx.Point(488,
              48), size=wx.Size(112, 24), style=wx.DP_SHOWCENTURY)

        self.dateSubmit = wx.DatePickerCtrl(id=wxID_PANELDELIVERYPLANCONTENTDATESUBMIT,
              name=u'dateSubmit', parent=self.panel_basic, pos=wx.Point(488,
              80), size=wx.Size(112, 24), style=wx.DP_SHOWCENTURY)

        self.choice_hour_submit = wx.Choice(choices=["00", "07", "08", "09",
              "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"],
              id=wxID_PANELDELIVERYPLANCONTENTCHOICE_HOUR_SUBMIT,
              name=u'choice_hour_submit', parent=self.panel_basic,
              pos=wx.Point(616, 80), size=wx.Size(48, 24), style=0)
        self.choice_hour_submit.SetSelection(0)

        self.choice_hour_return = wx.Choice(choices=["00", "07", "08", "09",
              "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
              "21", "22", "23"],
              id=wxID_PANELDELIVERYPLANCONTENTCHOICE_HOUR_RETURN,
              name=u'choice_hour_return', parent=self.panel_basic,
              pos=wx.Point(616, 48), size=wx.Size(48, 24), style=0)
        self.choice_hour_return.SetSelection(0)

        self.choice_hour_send = wx.Choice(choices=["00", "07", "08", "09", "10",
              "11", "12", "13", "14", "15", "16", "17", "18"],
              id=wxID_PANELDELIVERYPLANCONTENTCHOICE_HOUR_SEND,
              name=u'choice_hour_send', parent=self.panel_basic,
              pos=wx.Point(616, 16), size=wx.Size(48, 24), style=0)
        self.choice_hour_send.SetSelection(0)

        self.staticText2 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT2,
              label=u':', name='staticText2', parent=self.panel_basic,
              pos=wx.Point(668, 20), size=wx.Size(9, 16), style=0)

        self.staticText3 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT3,
              label=u':', name='staticText3', parent=self.panel_basic,
              pos=wx.Point(668, 52), size=wx.Size(9, 16), style=0)

        self.staticText8 = wx.StaticText(id=wxID_PANELDELIVERYPLANCONTENTSTATICTEXT8,
              label=u':', name='staticText8', parent=self.panel_basic,
              pos=wx.Point(668, 82), size=wx.Size(8, 16), style=0)

        self.choice_min_submit = wx.Choice(choices=["00", "10", "20", "30",
              "40", "50"], id=wxID_PANELDELIVERYPLANCONTENTCHOICE_MIN_SUBMIT,
              name=u'choice_min_submit', parent=self.panel_basic,
              pos=wx.Point(680, 80), size=wx.Size(48, 24), style=0)
        self.choice_min_submit.SetSelection(0)

        self.choice_min_return = wx.Choice(choices=["00", "10", "20", "30",
              "40", "50"], id=wxID_PANELDELIVERYPLANCONTENTCHOICE_MIN_RETURN,
              name=u'choice_min_return', parent=self.panel_basic,
              pos=wx.Point(680, 48), size=wx.Size(48, 24), style=0)
        self.choice_min_return.SetSelection(0)

        self.choice_min_send = wx.Choice(choices=["00", "10", "20", "30", "40",
              "50"], id=wxID_PANELDELIVERYPLANCONTENTCHOICE_MIN_SEND,
              name=u'choice_min_send', parent=self.panel_basic,
              pos=wx.Point(680, 16), size=wx.Size(48, 24), style=0)
        self.choice_min_send.SetSelection(0)

        self.btnSave = wx.Button(id=wxID_PANELDELIVERYPLANCONTENTBTNSAVE,
              label=u'\u4fdd\u5b58', name=u'btnSave', parent=self.panel_basic,
              pos=wx.Point(760, 16), size=wx.Size(93, 26), style=0)
        self.btnSave.Bind(wx.EVT_BUTTON, self.OnBtnSaveButton,
              id=wxID_PANELDELIVERYPLANCONTENTBTNSAVE)

        self.checkBox_alarm_customer = wx.CheckBox(id=wxID_PANELDELIVERYPLANCONTENTCHECKBOX_ALARM_CUSTOMER,
              label=u'\u5ba2\u60c5\u8b66\u62a5',
              name=u'checkBox_alarm_customer', parent=self.panel3,
              pos=wx.Point(376, 16), size=wx.Size(105, 16), style=0)
        self.checkBox_alarm_customer.SetValue(False)
        self.checkBox_alarm_customer.Bind(wx.EVT_CHECKBOX,
              self.OnCheckBox_alarm_customerCheckbox,
              id=wxID_PANELDELIVERYPLANCONTENTCHECKBOX_ALARM_CUSTOMER)

        self._init_coll_notebook1_Pages(self.notebook1)
        self.checkBox_hasDebt = wx.CheckBox(id=wxID_PANELDELIVERYPLANCONTENTCHECKBOX_HASDEBT,
              label=u'\u65e7\u5355\u672a\u7ed3', name=u'checkBox_hasDebt',
              parent=self.panel3, pos=wx.Point(504, 16), size=wx.Size(105, 16),
              style=0)
        self.checkBox_hasDebt.SetValue(False)
        self.checkBox_hasDebt.Bind(wx.EVT_CHECKBOX,
              self.OnCheckBox_hasDebtCheckbox,
              id=wxID_PANELDELIVERYPLANCONTENTCHECKBOX_HASDEBT)

    def __init__(self, parent):
        self._init_ctrls(parent)
        
        self.m_showAllRegion = True
        
        self.lcRouteDetail = MyListCtrlRouteDetail(self.panel3)
        self.lcRouteDetail.Move(wx.Point(8, 40))
        self.lcRouteDetail.SetSize(wx.Size(160, 300))
        self.lcRouteDetail.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnRegionItemSelected)

        self.lcCustomer = MyListCtrlRegionCustomer(self.panel3)
        self.lcCustomer.Move(wx.Point(180, 80))
        self.lcCustomer.SetSize(wx.Size(800, 260))
        
        self.splitterWin = MultiSplitterWindow(self.panel1, style=wx.SP_LIVE_UPDATE)
        
        self.lcBill = MyListCtrlDeliverySaleOrder(self.splitterWin)
        #self.lcBill.Move(wx.Point(10, 10))
        #self.lcBill.SetSize(wx.Size(1000, 200))
        self.lcBill.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnBillListItemSelected)

        self.lcContent = MyOrderContentListCtrl(self.splitterWin)
        #self.lcContent.Move(wx.Point(10, 220))
        #self.lcContent.SetSize(wx.Size(1000, 200))
        
        self.lcBill.SetMinSize(wx.Size(900, 50))
        self.splitterWin.AppendWindow(self.lcBill, 200)
        
        self.lcContent.SetMinSize(wx.Size(900, 50))
        self.splitterWin.AppendWindow(self.lcContent)
        
        self.splitterWin.Move(wx.Point(10, 10))
        # 设置大小为什么必须放在最后？放在AppendWindow之前导致sashPos参数不起作用
        self.splitterWin.SetSize(wx.Size(980, 330))
        self.splitterWin.SetOrientation(wx.VERTICAL)
        self.splitterWin.SizeWindows()
        
        self.lcProList = MyListCtrlDeliveryPlanProDetail(self.panel2)
        self.lcProList.Move(wx.Point(10, 10))
        self.lcProList.SetSize(wx.Size(980, 330))
        
        #self.datePlan.SetValue(wx.DateTime.Today())
        #self.refreshBillId()
        
        self.cbTruck = MyComboBoxDecorator(self.comboTruck, CDataTruck, CDataTruck.fi_id)
        self.cbTruck.refresh()
        
        self.cbDriver = MyComboBoxDecorator(self.comboDriver, CDataStaff, CDataStaff.COL_NAME, only_driver)
        self.cbDriver.refresh()
        
        self.cbFollower = MyComboBoxDecorator(self.comboFollower, CDataStaff, CDataStaff.COL_NAME, only_driver)
        self.cbFollower.refresh()
        
        self.cbState = MyComboBoxDecorator(self.comboState, CDataDeliveryState, CDataDeliveryState.fi_name)
        self.cbState.refresh()
        self.cbState.SetValue(CDataDeliveryState.getDefState().getValue(CDataDeliveryState.fi_name))
        
        self.cbSubmitter = MyComboBoxDecorator(self.comboSubmit, CDataStaff, CDataStaff.COL_NAME, only_driver)
        self.cbSubmitter.refresh()
        
        self.m_route = None
        self.m_plan = None
    
    def setData(self, planId):
        self.m_plan = CDataDeliveryPlan.getFirstInstance({CDataDeliveryPlan.fi_id:planId})
        
        self.loadBill(self.m_plan)
        
        self.lcBill.refresh({'deliveryPlan':self.m_plan.getKeyVal()})
        self.lcContent.DeleteAllItems() 
        
        self.selectRoute(CDataDeliveryRoute.findObj(self.m_plan.getValue(self.m_plan.fi_routeId)))
        self.lcProList.refresh({'deliveryPlan':self.m_plan.getKeyVal()})
        
    def selectRoute(self, routeObj):
        self.m_route = routeObj
        #self.tcRoute.SetValue(self.m_route.getValue(self.m_route.fi_name))
        
        self.lcRouteDetail.refresh({'routeId':self.m_route.getValue(self.m_route.fi_id)})
        self.button_all_region.SetLabel("ALL ("+str(self.lcRouteDetail.m_active_customer_count)+"/"+str(self.lcRouteDetail.m_customer_count)+")")
        self.lcCustomer.DeleteAllItems() 
        
    def OnBillListItemSelected(self, event):
        '''按照选中订单，显示订单内容'''
        item = self.lcBill.GetNextItem(-1, state = wx.LIST_STATE_SELECTED)
        #orderId = self.orderList.GetItem(item, self.orderList.COL_ID).GetText()
        billId = self.lcBill.getBillId(item)
        self.lcContent.refresh({'billId':billId})
        
    def OnRegionItemSelected(self, event):
        if not self.m_plan:
            dlg = wx.MessageDialog(self, u'请先保存送货计划'
                ,u'提示',wx.OK|wx.ICON_ERROR)
            dlg.ShowModal()
            return
            
        self.m_showAllRegion = False
        item = self.lcRouteDetail.GetNextItem(-1, state = wx.LIST_STATE_SELECTED)
        regionId = self.lcRouteDetail.getRegionId(item)
        self.lcCustomer.refresh({
            'planId':self.m_plan.getKeyVal(),
            'regionId':regionId,
            'only_wujindian': self.checkBox_only_shop.GetValue(),
            'only_alarm_customer':self.checkBox_alarm_customer.GetValue(),
            'only_send_debt':self.checkBox_hasDebt.GetValue()
        })
        
    def OnButton_all_regionButton(self, event):
        if not self.m_plan:
            dlg = wx.MessageDialog(self, u'请先保存送货计划'
                ,u'提示',wx.OK|wx.ICON_ERROR)
            dlg.ShowModal()
            return
            
        self.m_showAllRegion = True
        self.lcCustomer.refresh({
            'planId':self.m_plan.getKeyVal(),
            'routeId':self.m_route.getValue(self.m_route.fi_id),
            'only_wujindian': self.checkBox_only_shop.GetValue(),
            'only_alarm_customer':self.checkBox_alarm_customer.GetValue(),
            'only_send_debt':self.checkBox_hasDebt.GetValue()
        })
        event.Skip()

    def OnCheckBox_only_shopCheckbox(self, event):

        if (not self.m_showAllRegion):
            self.OnRegionItemSelected(event)
        else:
            self.OnButton_all_regionButton(event)
        
        event.Skip()

    def update_state(self, state):
        if not self.m_plan:
            dlg = wx.MessageDialog(self, u'请先保存送货计划'
                ,u'提示',wx.OK|wx.ICON_ERROR)
            dlg.ShowModal()
            return
            
        item = self.lcCustomer.GetNextItem(-1, state = wx.LIST_STATE_SELECTED)
        if (item >= 0):
            self.m_plan.set_state(self.lcCustomer.getCustomerId(item), state)
            self.lcCustomer.set_item_text(item, state)
            
    def OnButton_wechatButton(self, event):
        self.update_state("b_wechat")            
        event.Skip()

    def OnButton_phoneButton(self, event):
        self.update_state("b_phone")
        event.Skip()
        
    def OnButton_orderButton(self, event):
        self.update_state("b_order")
        event.Skip()

    def update_memo(self, memo):
        if not self.m_plan:
            dlg = wx.MessageDialog(self, u'请先保存送货计划'
                ,u'提示',wx.OK|wx.ICON_ERROR)
            dlg.ShowModal()
            return
            
        item = self.lcCustomer.GetNextItem(-1, state = wx.LIST_STATE_SELECTED)
        if (item >= 0):
            self.m_plan.set_memo(self.lcCustomer.getCustomerId(item), memo)
            self.lcCustomer.set_item_text(item, "memo", memo)
        
    def OnButton_memo_inputButton(self, event):
        dlg = wx.TextEntryDialog(self, u'请输入',
                                u'提示',u'',wx.OK|wx.CANCEL|wx.CENTRE)
        if dlg.ShowModal() != wx.ID_OK:
            return
        self.update_memo(dlg.GetValue())
        event.Skip()    

    def OnButton_no_needButton(self, event):
        self.update_memo(u"不要货")

    def OnButton_laterButton(self, event):
        self.update_memo(u"再联系")
        event.Skip()

    def OnButton_noanswerButton(self, event):
        self.update_memo(u"没打通")
        event.Skip()

    def OnButton_checkitButton(self, event):
        self.update_memo(u"看一下")
        event.Skip()

    def OnBtnSaveButton(self, event):
        self.trySave()

    def trySave(self):
        import dbmngr
        import kit
        
        data = {}
        #data[CDataDeliveryPlan.fi_id] = self.tcBillNo.GetValue()
        #data[CDataDeliveryPlan.fi_planDate] = kit.str2Date(self.datePlan.GetValue().Format('%Y-%m-%d'))
            
        data[CDataDeliveryPlan.fi_sendDate] = kit.str2DateTime(self.dateSend.GetValue().Format('%Y-%m-%d')
            , self.choice_hour_send.GetString(self.choice_hour_send.GetCurrentSelection())
            , self.choice_min_send.GetString(self.choice_min_send.GetCurrentSelection())
            , "00")
        data[CDataDeliveryPlan.fi_returnDate] = kit.str2DateTime(self.dateReturn.GetValue().Format('%Y-%m-%d')
            , self.choice_hour_return.GetString(self.choice_hour_return.GetCurrentSelection())
            , self.choice_min_return.GetString(self.choice_min_return.GetCurrentSelection())
            , "00")
        
        data[CDataDeliveryPlan.fi_submit_date] = kit.str2DateTime(self.dateSubmit.GetValue().Format('%Y-%m-%d')
            , self.choice_hour_submit.GetString(self.choice_hour_submit.GetCurrentSelection())
            , self.choice_min_submit.GetString(self.choice_min_submit.GetCurrentSelection())
            , "00")
        
        submitter = self.cbSubmitter.getSelectObj()
        if submitter:
            data[CDataDeliveryPlan.fi_submitter] = submitter.getKeyVal()
        
        data[CDataDeliveryPlan.fi_km_send] = kit.str2Int(self.TCSendKM.GetValue())
        data[CDataDeliveryPlan.fi_km_return] = kit.str2Int(self.TCReturnKM.GetValue())
        data[CDataDeliveryPlan.fi_return_memo] = self.TCReturnMemo.GetValue()
        
        data[CDataDeliveryPlan.fi_meals_fee] = self.TCMealsFee.GetValue()
        data[CDataDeliveryPlan.fi_other_fee] = self.TCOtherFee.GetValue()
        data[CDataDeliveryPlan.fi_toll_fee] = self.TCTollFee.GetValue()
        
        truck = self.cbTruck.getSelectObj()
        if truck:
            data[CDataDeliveryPlan.fi_truck] = truck.getKeyVal()
        else:
            data[CDataDeliveryPlan.fi_truck] = None
            
        driver = self.cbDriver.getSelectObj()
        if driver:
            data[CDataDeliveryPlan.fi_driver] = driver.getKeyVal()
        else:
            data[CDataDeliveryPlan.fi_driver] = None
            
        follower = self.cbFollower.getSelectObj()
        if follower:
            data[CDataDeliveryPlan.fi_follower1] = follower.getKeyVal()
        else:
            data[CDataDeliveryPlan.fi_follower1] = None
            
        #data[CDataDeliveryPlan.fi_follower2] = None
        data[CDataDeliveryPlan.fi_routeId] = self.m_route.getKeyVal()
        
        state = self.cbState.getSelectObj()
        if state:
            data[CDataDeliveryPlan.fi_state] = state.getKeyVal()
        
        data[CDataDeliveryPlan.fi_memo] = self.tcMemo.GetValue()
          
        self.m_plan.setMulFieldVal(data)
        self.m_plan.update()
   
    def loadBill(self, planObj):
        import kit        
        #self.tcBillNo.SetValue(planObj.getKeyVal())
        
        #self.datePlan.SetValue(kit.getWxDate(planObj.getValue(planObj.fi_planDate)))
        self.dateSend.SetValue(kit.getWxDate(planObj.getValue(planObj.fi_sendDate)))
        self.dateSubmit.SetValue(kit.getWxDate(planObj.getValue(planObj.fi_submit_date)))
        
        self.choice_hour_send.SetStringSelection("%02d"%(planObj.getValue(planObj.fi_sendDate).hour))
        self.choice_min_send.SetStringSelection("%02d"%(planObj.getValue(planObj.fi_sendDate).minute))
        self.choice_hour_return.SetStringSelection("%02d"%(planObj.getValue(planObj.fi_returnDate).hour))
        self.choice_min_return.SetStringSelection("%02d"%(planObj.getValue(planObj.fi_returnDate).minute))
        self.choice_hour_submit.SetStringSelection("%02d"%(planObj.getValue(planObj.fi_submit_date).hour))
        self.choice_min_submit.SetStringSelection("%02d"%(planObj.getValue(planObj.fi_submit_date).minute))
        
        self.dateReturn.SetValue(kit.getWxDate(planObj.getValue(planObj.fi_returnDate)))
        self.cbTruck.SetValue(planObj.getTruckName())
        self.cbDriver.SetValue(planObj.getDriverName())
        self.cbFollower.SetValue(planObj.getFollowerName())
        self.cbState.SetValue(planObj.getStateName())
        self.tcMemo.SetValue(planObj.getValue(planObj.fi_memo))
        
        self.cbSubmitter.SetValue(planObj.getSubmitterName())
        self.TCSendKM.SetValue(str(planObj.getValue(planObj.fi_km_send) or ""))
        self.TCReturnKM.SetValue(str(planObj.getValue(planObj.fi_km_return) or ""))
        self.TCReturnMemo.SetValue(planObj.getValue(planObj.fi_return_memo))
        
        self.TCMealsFee.SetValue(str(planObj.getValue(planObj.fi_meals_fee)))
        self.TCOtherFee.SetValue(str(planObj.getValue(planObj.fi_other_fee)))
        self.TCTollFee.SetValue(str(planObj.getValue(planObj.fi_toll_fee)))
        
        #self.lcBill.refresh({'deliveryPlan':planObj.getKeyVal()})
        #self.selectRoute(CDataDeliveryRoute.findObj(planObj.getValue(planObj.fi_routeId)))
        #self.lcProList.refresh({'deliveryPlan':planObj.getKeyVal()})

    def OnCheckBox_alarm_customerCheckbox(self, event):
        if (not self.m_showAllRegion):
            self.OnRegionItemSelected(event)
        else:
            self.OnButton_all_regionButton(event)
        
        

    def OnCheckBox_hasDebtCheckbox(self, event):
        if (not self.m_showAllRegion):
            self.OnRegionItemSelected(event)
        else:
            self.OnButton_all_regionButton(event)
        
